package com.hui.qiniucloud.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 聊天历史响应DTO
 */
@Data
@Schema(description = "聊天历史响应")
public class ChatHistoryResponse {

    @Schema(description = "会话信息")
    private SessionInfo session;

    @Schema(description = "消息列表")
    private List<MessageInfo> messages;

    @Data
    @Schema(description = "会话信息")
    public static class SessionInfo {
        @Schema(description = "会话ID", example = "1")
        private Long id;

        @Schema(description = "会话标题", example = "关于魔法的讨论")
        private String title;

        @Schema(description = "角色信息")
        private CharacterInfo character;
    }

    @Data
    @Schema(description = "消息信息")
    public static class MessageInfo {
        @Schema(description = "消息ID", example = "1")
        private Long id;

        @Schema(description = "角色：user-用户，assistant-助手", example = "user")
        private String role;

        @Schema(description = "消息内容", example = "你好")
        private String content;

        @Schema(description = "创建时间")
        private LocalDateTime createdTime;
    }

    @Data
    @Schema(description = "角色信息")
    public static class CharacterInfo {
        @Schema(description = "角色ID", example = "harry_potter")
        private String id;

        @Schema(description = "角色名称", example = "哈利·波特")
        private String name;

        @Schema(description = "角色头像", example = "https://img.qiniucdn.com/avatar/harry.jpg")
        private String avatar;
    }
}